Targeted Gene Metagenomic Data Analysis ◾ 295
qiime taxa filter-table \
--i-table dada2/table_feat_sample_freq_filtered_yoga_dada2.qza \
--i-taxonomy taxonomy/nb_tax_yoga_dada2.qza \
--p-include p__\
--o-filtered-table dada2/table_phylum_yoga_dada2.qza
qiime taxa barplot \
--i-table dada2/table_phylum_yoga_dada2.qza \
--i-taxonomy taxonomy/nb_tax_yoga_dada2.qza \
--m-metadata-file data/sample-metadata.tsv \
--o-visualization taxonomy/nx_phylum_yoga_dada2_barplot.qzv
qiime tools view taxonomy/nx_phylum_yoga_dada2_barplot.qzv
Assume that you intend to explore the species under the “p__Bacteroidetes” phylum. Thus,
you can use “p__Bacteroidetes” to retain the features that contain this.
qiime taxa filter-table \
--i-table dada2/table_feat_sample_freq_filtered_yoga_dada2.qza \
--i-taxonomy taxonomy/nb_tax_yoga_dada2.qza \
--p-include “p__Bacteroidetes”\
--o-filtered-table taxonomy/table_Bacteroidetes_yoga_dada2.qza
qiime taxa barplot \
--i-table taxonomy/table_Bacteroidetes_yoga_dada2.qza \
--i-taxonomy taxonomy/nb_tax_yoga_dada2.qza \
--m-metadata-file data/sample-metadata.tsv \
--o-visualization taxonomy/nx_Bacteriodetes_yoga_dada2_barplot.
qzv
qiime tools view taxonomy/nx_Bacteriodetes_yoga_dada2_barplot.qzv
A metagenomic study may have a specific design such as groups, treatment, and facto-
rial design. The groups are to be specified in the sample metadata file as discussed above.
Grouping samples in an analysis by a group or multiple groups can be achieved by “feature-
table group”. The following script creates a feature table in which the samples are grouped
by the “group” column of the sample metadata file:
qiime feature-table group \
--i-table dada2/table_feat_sample_freq_filtered_yoga_dada2.qza \
--p-axis sample \
--m-metadata-file data/sample-metadata.tsv \
--m-metadata-column group \
--p-mode sum \
--o-grouped-table taxonomy/groupedby-group-yoga-table.qza
You can then create a barplot visualization for the new feature table; however, you need to
create a new metadata file in which the group levels (the metadata column which was used
for grouping) will be as sample ID. The metadata “taxonomy/group_metadata.tsv” will be
as in Figure 7.17.